#ifndef TOOLGUI_H
#define TOOLGUI_H
#include "analy/branch/ToolBranchBT.h"
#include "analy/branch/ToolBranchCT.h"
#include "analy/branch/ToolBranchRF.h"
#include "order/PowerStationPool.h"
#include "solar/trunk/NWidget.h"
#include "solar/trunk/NbaseWin.h"
#include "intend/IceSailing.h"
#include "tools/Gadget.h"
#include "tools/Wings.h"
#include "tools/Pyscript.h"
#include <QtCore/Qt>
#include <QtWidgets>
#include <QSqlError>


typedef enum {
    SerialPort,
    BaudRate,
    DtPlace,
    StPlace,
    Scontrol,
    CheckPlace
} SerialAttribute;


class ToolWin :
        public NMainWindow,
        public ToolBranchBT,
        public ToolBranchCT,
        public ToolBranchRF
{

    Q_OBJECT

public:
    ToolWin(QMap<QString, QMap<QString, QString>> &_RGLRLSMAP_,
            QSqlDatabase *_DATABASE_,
            QMap<QString, QString> &_QSSMAP_);
    ~ToolWin();


protected:

    QMap<QString, QMap<QString, QString>> *__RLMAP__;
    QMap<QString, QString> *__QSSMAP__;
    QMap<QString, QString> impact_str;
    QMap<QString, bool> impact_swtc;
    QMap<QString, qint64> impact_int;
    QMap<QString, qint64> impact_ttype;
    QMap<QString, QList<qint64>> impact_stint;
    QMap<ThreadPoint, NT::THREAD_STATE> impact_thread;
    QMap<QString, QList<QList<QString>>> impact_stspchar;
    QMap<QString, QList<QString>> impact_stchar;

    QWidget *CloakMain = new QWidget();
    Nwidget *Global_TWidget = new Nwidget(CloakMain);
    QGridLayout *Global_TGrid = new QGridLayout();
    Nwidget *Active_contentWidet = new Nwidget(CloakMain);
    QGridLayout *Active_contentGrid = new QGridLayout();
    QGridLayout *Active_Left_Grid = new QGridLayout();
    QGridLayout *Active_Right_Grid = new QGridLayout();

    QSqlDatabase *DATABASE;
    QSqlQuery *Query;
    DialPool *BoilPool;
    QPoint MSSTART;
    QPoint MSEND;
    QPoint MSMV;
    MOUSE_ATTRIBUTE MSEVKEY;
    KEY_ATTRIBUTE RPLKEY;

    Nlwingsing wingsing;
    Extend definfc;
    QList<QString> AnalyFuncList = {"文档数据比对", "Unicode/Chz"};
    QList<QAction *> SPActionList;
    QTimer GLOBAL_DBLOOP_QTIER;
    QTimer TOOL_MENUADJST_QTIER;
    QTimer SRLP_DLRMV_QTIER;
    QTimer SRLP_LOOPGETP_QTIER;
    QTimer SRLP_HLDLECHO_QTIER;
    QTimer GLOBAL_ARGUR_QTIER;
    QTimer SRLP_HLDLTRIGG_QTIER;
    QTimer SRLP_CMDLOOP_QTIER;

    QColorDialog colorDia;

    int RegisterSpToolsCount;

    void SP_setActionAdjustSize(QToolButton *Button);

signals:
    void sg_system_quit(bool, NT::WIN_QUIT_ATTRIBUTE);
    void VariantPopuEvent(QPair<NT::TASKEXEC, QVariant>);
};
#endif

